{% extends "base.html" %}
{% load static %}

{% block content %}
    {{ block.super }}
    <h3> Edit Product ({{ product.name }}) Metadata</h3>
    <br/>
    <form class="form-horizontal" method="post">{% csrf_token %}
        {% for cf in product.product_meta.all %}
            <div class="form-group">
                <label class="col-sm-2 control-label" for="cfv_{{ cf.id }}">{{ cf.name }}</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="cfv_{{ cf.id }}" name="cfv_{{ cf.id }}"
                           value="{{ cf.value }}">
                    <span for="cfv_{{ cf.id }}">Delete</span>
                    <input type="checkbox" label="Delete Checkbox" name="delete_cfv_{{ cf.id }}" id="delete_cfv_{{ cf.id }}"/>
                </div>
            </div>
        {% endfor %}
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input class="btn btn-primary" type="submit" name="add" value="Save"/>
            </div>
        </div>
    </form>
{% endblock %}
